import { h } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'

import IFrameCanvasView from '@/views/IFrameCanvasView.vue'
import NormalEditor from '@/views/NormalEditor.vue'
import { IFramePreviewer } from '@dev-crafter/editor-antdv'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'normal',
      component: NormalEditor,
    },
    {
      path: '/canvas-render',
      name: 'canvasRender',
      component: IFrameCanvasView,
    },
    {
      path: '/preview-render',
      name: 'previewRender',
      component: h(IFramePreviewer, { components: {} }),
    },
  ],
})

export default router
